package com.xiashitech.agent.instrumentation.db.statement.inst;

import com.google.auto.service.AutoService;
import com.xiashitech.agent.instrumentation.db.statement.inst.XSPreparedStatementInstrumentation;
import com.xiashitech.agent.instrumentation.db.statement.inst.XSStatementInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;

import java.util.Arrays;
import java.util.List;

import static java.util.Arrays.asList;

@AutoService(InstrumentationModule.class)
public class XSJdbcInstrumentationModule extends InstrumentationModule {
    public XSJdbcInstrumentationModule() {
        super("XSJdbc");
    }
    @Override
    public List<TypeInstrumentation> typeInstrumentations() {
        return asList(new XSPreparedStatementInstrumentation(),new XSStatementInstrumentation());
    }

    @Override
    public List<String> getAdditionalHelperClassNames() {
        return Arrays.asList("com.xiashitech.agent.instrumentation.db.statement.XSJdbcSingletons",
                "com.xiashitech.agent.instrumentation.db.statement.XSJdbcAttributesExtractor",
                "com.xiashitech.agent.instrumentation.helper.calldepth.XSStatementCallDepth",
                "com.xiashitech.agent.service.UserTracingService",
                "com.xiashitech.agent.instrumentation.db.statement.sanitizer.impl.XSSqlSanitizer",
                "com.xiashitech.agent.instrumentation.db.statement.sanitizer.impl.XSSqlLocalSanitizer",
                "com.xiashitech.agent.instrumentation.db.statement.XSJdbcSpanNameExtractor",
                "com.xiashitech.agent.utils.SessionUtil");
    }
}
